<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>登录</title>
    <link href="/resources/css/css.css" rel="stylesheet" type="text/css"/>
    <script src="/resources/common/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="/resources/common/js/md5.js"></script>
    <script type="text/javascript" src="/resources/js/self.js"></script>
    <script type="application/javascript">
        gotoLoginUrl("/html/security/login.html");
    </script>
    <style type="text/css">
        input::-webkit-input-placeholder {
            color: #fff;
        }

        input::-moz-placeholder { /* Mozilla Firefox 19+ */
            color: #fff;
        }

        input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
            color: #fff;
        }

        input:-ms-input-placeholder { /* Internet Explorer 10-11 */
            color: #fff;
        }
    </style>
    <!--<style>-->
    <!--body {margin:0;	padding:0;font-size:12px; color:#191919;line-height:24px; background:url(/resources/images/login_01.jpg) top repeat-x #52acda; height:100%;}-->
    <!--* { margin:0; padding:0; }-->
    <!--.clearfix { clear:both; }-->
    <!--a:link{ color:#2b2b2b; text-decoration:none;}-->
    <!--a:hover,a:active { color:#ff0000;}-->
    <!--ul { list-style:none; }-->
    <!--.block-foot{display:none; }-->
    <!--img { border:none;}-->

    <!--.dlbg{ width:100%; margin:0 auto; }-->
    <!--.title{ width:822px; margin:0 auto;}-->
    <!--.mainbg{ width:100%; margin:0 auto; background:url(/resources/images/login_018.png) top center no-repeat; height:352px;  margin-top:50px;}-->
    <!--.liginm{ width:230px; margin:0 auto; padding-top:105px;}-->
    <!--.liginm ul li{ float:left; width:100%; margin-top:10px;}-->
    <!--.liginm ul li h1{ font-size:12px; color:#0f0f0f; font-weight:normal; float:left; width:50px;}-->
    <!--.liginm ul li span{ float:left; width:179px;}-->
    <!--.liginm ul li span input{ width:160px; height:25px; line-height:25px; background:#fff; border:1px solid #8c9d97;}-->

    <!--.dlzc{ width:100%; margin:0 auto;}-->
    <!--.dlzc a{ background:url(/resources/images/login_08.png) 0 0 no-repeat; width:91px; margin:0 auto; margin-top:22px; height:27px; color:#fff; text-align:center; line-height:27px; display:block;}-->
    <!--.dlzc a:hover{ background:url(/resources/images/login_08.png) 0 -1px no-repeat; width:91px; margin:0 auto; margin-top:22px;  height:27px; color:#fff; text-align:center; line-height:27px; display:block;}-->
    <!--.copyright{     width: 1080px; text-align:right; margin: 0 auto; margin-top:0px;}-->

    <!--/*.btombg{ width:100%; height:27px; background:url(/resources/images/login_03.jpg) repeat-x; position:fixed; bottom:0;}*/-->
    <!--</style>-->
</head>

<body>
<div class="zcbg" style="padding-top:100px;background-size: cover;">
    <div class="zcmain">
        <div class="zctitle"><img src="/resources/images/dllogo.png"/></div>
        <div class="zcbody" style="height: 270px;">
            <div class="zcxx" style="margin-bottom: 40px;">
                <ul>
                    <li><p>用户名：</p><span><input class="dlname" name="account" type="text"/></span></li>
                    <li><p>密 码：</p><span><input class="dlname" name="password" type="password"/></span></li>
                </ul>

                <div class="clearfix"></div>
            </div>
            <!--<div class="dlzc">-->
            <button style="float: left;margin-left: 85px;" class="dlbut" data_t="admin" onclick="login(this)">管理员登录</button>
            <button style="float: left;;margin-left: 50px;" class="dlbut" data_t="mj" onclick="login(this)">民警登录</button>
            <!--</div>-->

        </div>
        <!--<div class="btombg"></div>-->
        <!--<div class="copyright"><img src="/resources/images/login_07.png"/></div>-->
    </div>
</div>
</body>
<script type="text/javascript">


    function login(t){
        var type = $(t).attr("data_t");
        var account = $("input[name='account']").val();
        var password = $("input[name='password']").val();
        if (account.replace(/\s/g, '') == '') {
            alert("请输入登陆账号");
            return;
        }
        if (password.replace(/\s/g, '') == '') {
            alert("请输入密码");
            return;
        }
        var params = {};
        params['account'] = account;
        params['password'] = hex_md5(password);
        var url = getLoginUrl(type);
        $.ajax({
            url: url,
            type: 'post',
            data: params,
            success: function (data) {
                if (data.success && (data.data.type == 'security')) {
                    window.location.href = "/html/security/index.html?r=" + new Date().getTime();
                } else if (data.success && data.data.type == 'subSecurity') {
                    window.location.href = "/html/security/p_index.html?r=" + new Date().getTime();
                } else {
                    alert(data.msg);
                }
            },
            error: function () {
                alert("系统错误！");
            }
        });
    }

    function getLoginUrl(type) {
        var url = "/admin/loginOn.do";
        if (type == 'mj') {
            url = "/admin/police/loginOn.do";
        }
        return url;
    }


</script>
</html>
